package synchronize.synchronize001;

public class MyThreadTest extends Thread {
    private int count = 5;

    @Override
    public void run() {
        count--;
        System.out.println(this.currentThread().getName() + ",count:" + count);
    }


    public static void main(String[] args) {
        MyThreadTest myThread = new MyThreadTest();

        Thread t1 = new Thread(myThread, "t1");
        Thread t2 = new Thread(myThread, "t2");
        Thread t3 = new Thread(myThread, "t3");
        Thread t4 = new Thread(myThread, "t4");
        Thread t5 = new Thread(myThread, "t5");
        Thread t6 = new Thread(myThread, "t6");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();


    }

}
